import { Component } from 'react';
import observe from '../utils/observe'
class Child1 extends Component {
    constructor(props) {
        super()
        console.log('组件结构生成')
    }

    componentWillMount () {
        console.log('dom将要渲染了')
        observe.subscribe((data) => {
            console.log(data)
        })
    }
    shouldComponentUpdate(nextProps) {
        console.log(nextProps)
        return true
    }
    render() {
        console.log('返回要要渲染的dom')
        return (<div>
            这是组件一
        </div>)
    }

    componentDidMount() {
        console.log('dom渲染完成了')

    }

    componentWillUnmount() {
        console.log('页面销毁的生命周期')
    }
}

export default Child1